package com.util.StringTokenizer;

import org.junit.Test;

import java.util.StringTokenizer;

public class StringTokenizerDemo {

    /**
     * 将str字符串分隔
     */
    @Test
    public void testConstruct(){
        String str = "a|b|c";
        StringTokenizer st = new StringTokenizer(str, "|");
        while(st.hasMoreTokens()){
            System.out.println(st.nextToken().trim());
        }
    }
}
